package com.electronsys.emp.action;




import java.util.Date;

import com.electronsys.emp.service.EmpDaoService;
import com.electronsys.pojo.Employee;
import com.electronsys.pojo.Log;
import com.electronsys.pojo.Module;
import com.electronsys.pojo.ModuleContent;
import com.opensymphony.xwork2.ActionSupport;



public class EmpInforAction extends ActionSupport{
    /**
	 * 
	 */
	private static final long serialVersionUID = -4633561670842417263L;
	public Integer empId;
    public EmpDaoService empDaoService;
    public Employee emp;
    public Log log;
    
    
	public Employee getEmp() {
		return emp;
	}
	public void setEmp(Employee emp) {
		this.emp = emp;
	}
	public String execute(){
		emp = empDaoService.empInforService(empId);
		log = new Log();
		
		Module module  = new Module(3003);
		ModuleContent moduleContent =new ModuleContent(5001);
		Employee employee = new Employee(1001);

		log.setLogDate(new Date());
		log.setModule(module);
		log.setModuleContent(moduleContent);
		log.setEmployee(employee);
		
		empDaoService.logEmp(log);	
		
		return "success";
	}
	public Integer getEmpId() {
		return empId;
	}
	public void setEmpId(Integer empId) {
		this.empId = empId;
	}
	public void setEmpDaoService(EmpDaoService empDaoService) {
		this.empDaoService = empDaoService;
	}
}
